package com.qf.Service.impl;

import com.qf.Dao.PatientHistoryDao;
import com.qf.Dao.impl.PatientHistoryDaoImpl;
import com.qf.entity.PatientHistory;

import java.sql.SQLException;
import java.util.List;

public class PatientHistoryServiceImpl implements PatientHistoryDao {
    private PatientHistoryDao patientHistoryDao = new PatientHistoryDaoImpl();

    @Override
    public List<PatientHistory> selectByPatientName(String patientName) {
        try {
            return patientHistoryDao.selectByPatientName(patientName);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public int addPatientName(PatientHistory patientHistory) {
        try {
            return patientHistoryDao.addPatientName(patientHistory);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public int updatePatientName(PatientHistory patientHistory) {
        try {
            return patientHistoryDao.updatePatientName(patientHistory);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public int deletePatientName(String patientName, String patient_Idcard) {
        try {
            return patientHistoryDao.deletePatientName(patientName, patient_Idcard);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }
}
